import { get, post, post_json } from '@/http/axios'
import Vue from 'vue'
import Vuex from 'vuex'



Vue.use(Vuex)

export default {
    namespaced:true,
  state: {
    carouselData:{},
    orderData:[],
  },
  mutations: {
      SET_CAROUSELDATA(state,carouselData){
          state.carouselData = carouselData
      },
      SET_ORDERDATA(state,orderData){
        state.orderData = orderData
    },
  },
  actions: {
    async getAllcarouselData({commit},payload) {
        let res = await get("/carousel/query",{status:"正常"});
        commit('SET_CAROUSELDATA',res.data.data)
      },
      async getAllorderData({commit},payload) {
        let res = await get("/order/pageQuery",payload);
        commit('SET_ORDERDATA',res.data.data.list)
        console.log(res);
      },
  },
  modules: {
  }
}